package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.member.MemberFinanceLogBO;
import com.ymk.service.IMemberFinanceLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 会员财务日志表 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-05-18
 */
@Service
public class MemberFinanceLogService implements IMemberFinanceLogService {

    @Override
    public MemberFinanceLogBO get(Map param) {
        return this.daoRouter.queryForObject("MemberFinanceLog.loadMemberFinanceLog", param);
    }

    @Override
    public List<MemberFinanceLogBO> list(Map param) {
        return this.daoRouter.query("MemberFinanceLog.loadMemberFinanceLog", param);
    }

    @Override
    public List<MemberFinanceLogBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("MemberFinanceLog.loadMemberFinanceLogForPage", pagination);
    }

    @Override
    public void post(MemberFinanceLogBO param) {
        this.daoRouter.insert("AMemberFinanceLog.insertMemberFinanceLog", param);
    }

    @Override
    public void update(MemberFinanceLogBO param) {
        this.daoRouter.update("AMemberFinanceLog.updateMemberFinanceLog", param);
    }

    @Override
    public void del(MemberFinanceLogBO param) {
        this.daoRouter.update("AMemberFinanceLog.delMemberFinanceLog", param);
    }

    @Override
    public BigDecimal sumMemberFinanceAmount(MemberFinanceLogBO param) {
        return this.daoRouter.queryForObject("MemberFinanceLog.sumMemberFinanceAmount", param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
